home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / sgiCD / README < prev   
Text File  |  1994-08-01  |  3KB  |  69 lines

  1.  
  2.  
  3. Here are a couple of programs I wrote to learn about the SGI CD audio library
  4. routines, as well as something about how audio CD data is stored.
  5.  
  6. Cdinfo displays some basic information about an audio disk - total length,
  7. number of tracks, length of each track, etc.
  8.  
  9. Cdreader plays an audio CD loaded in an SGI CDrom drive through the SGI
  10. Indigo's speaker.  This is NOT like SGI's "cdplayer", which simply commands the
  11. CD drive to play an audio CD, because in that case, the audio output is sent to
  12. the headphone jack on the front and the audio out jacks on the back of the
  13. drive.  This program uses SGI's libcdaudio routines to read the digital data
  14. directly from the CD, and play the samples through the Audio Processor.
  15.  
  16. Cdinfo and Cdreader may also work on other SGI models with similar audio
  17. capabilities, but I can't tell since I don't have access to any of them.  It
  18. uses an relatively insignificant amount of CPU (6-7% according to "top"), but
  19. does raise the load average up over 1.0.  Any significant amount of I/O by
  20. other programs causes slight pauses in the music, so I suspect that "cdreader"
  21. is using a fairly high percentage of the SCSI bandwidth.  This is not something
  22. you'd want to run every day, all day long, but it was fun to write, and will
  23. let me listen to an audio CD in a pinch.
  24.  
  25. While working on these programs, I discovered several problems in the SGI CD
  26. audio library routines and documentation.  These have already been reported to
  27. SGI customer service, so hopefully they'll be fixed by the next operating
  28. system release.  I wrote them using an SGI Indigo running Irix 4.0.1, with the
  29. ANSI C compiler (unknown version number - "cc -V" complains about being
  30. obsolete, and "file" command prints the same version number for every command
  31. on my system - they can't ALL be version 2.10).
  32.  
  33. 1.  The CDreadda(3) manpage says it returns the number of frames read.  In
  34.     reality, it returns the number of bytes read.  You have divide by
  35.     CDDA_BLOCKSIZE to get the number of frames.  I'd like to see SGI fix this
  36.     to match the manpage.  The number of frames is much more useful.
  37.  
  38. 2.  The CDgetstatus() routine resets the CDrom "current location" to the
  39.     beginning of the disc.  In other words as soon as you call it to find out
  40.     the current track/min/sec/frame, that information is no longer correct.
  41.  
  42. 3.  The include file "/usr/include/cdaudio.h" has an extra trailing comma in
  43.     the CDDATATYPES enumeration definition.  This is harmless, but produces the
  44.     following Warning message every time you re-compile (It doesn't show up if
  45.     you use the "-cckr" option):
  46.  
  47.     accom: Warning 314: /usr/include/cdaudio.h, line 324: Trailing comma in
  48.         enumeration is illegal: accepted as extension (ANSI C 3.5.2.2)
  49.            } CDDATATYPES;
  50.            ^
  51.  
  52.     Sure, this is easy to workaround on my workstation, but I'd like to see SGI
  53.     fix it so I don't have to do this every time an OS upgrade comes out.
  54.  
  55. 4.  The CDresetparser(3) manpage shows the syntax for CDdeleteparser().
  56.  
  57. 5.  The CDaudio(3) manpage mentions only "-lcdaudio".  I found that to link my
  58.     programs required an extra library.  You must use "-lcdaudio -lds".
  59.  
  60. --------
  61.  
  62. Again, THANKS SGI for making such wonderful libraries of routines available.
  63. Libaudio, libcdaudio, and the snoop(7) routines make my Indigo an extremely fun
  64. machine to use.
  65.  
  66.         Patrick Wolfe  (pwolfe@kai.com, uunet!uiucuxc!kailand!pwolfe)
  67.         System Programmer/Operations Manager, Kuck & Associates
  68.  
  69.